from apscheduler.schedulers.background import BackgroundScheduler, BlockingScheduler
from apscheduler.schedulers.asyncio import AsyncIOScheduler

"""
config example
        jobstores = {'default': RedisJobStore(**config['redis'])}
        executors = {'default': ThreadPoolExecutor(config.get('pool', 20))}
        job_defaults = {
            'coalesce': True,
            'max_instances': config.get('max_instances', 3)
        }
        if is_background:
            self.scheduler = BackgroundScheduler(jobstores=jobstores, executors=executors, job_defaults=job_defaults)
"""
scheduler = BlockingScheduler()
background_scheduler = BackgroundScheduler()
async_scheduler = AsyncIOScheduler()


if __name__ == '__main__':
    def a():
        print('a')

    scheduler.add_job(a, trigger='interval', seconds=5)
    scheduler.start()
